home *** CD-ROM | disk | FTP | other *** search
/ Belgian Amiga Club - ADF Collection / BS1 part 47.7z / BS1 part 47 / ImageMaster RT v1.50b (1994)(Black Belt Systems)(Disk 6 of 7)[HD].7z / ImageMaster RT v1.50b (1994)(Black Belt Systems)(Disk 6 of 7)[HD].adf / piarc.lzh.parta / imiv24r.rexx < prev    next >
OS/2 REXX Batch file  |  1994-03-17  |  5KB  |  160 lines

  1. /*
  2.  * IMIV24r.rexx  a P.I. module to display the Image from Imagemaster
  3.  *               or Image Professional on GVP's IV-24 in 24-bit color
  4.  *               
  5.  *
  6.  *  Written by: Barry Chalmers
  7.  *         For: Black Belt Systems image processing series IM, IM F/c, and IP.
  8.  * Last Update: May 13th, 1992
  9.  * ---------------------------------------------------------------------------
  10.  * Revision: 1.00  Jan 17, 1992  -  Initial implementation
  11.  *           1.01  May  8, 1992  -  Pal resolutions;
  12.  *                                  slightly faster;
  13.  *                                  Requires IM version 9.11 or later.
  14.  *           1.02  May 13, 1992  -  Bug fixed vertical PAL size got turned on
  15.  *                                  in non-PAL setup;
  16.  *                                  Clearer description of 'mode' default.
  17.  */
  18. call pragma('stack',20000);
  19.  
  20. /*
  21.  * Default display mode   - This is not usually changed by the user
  22.  *                          but the program is capable of it
  23.  */
  24.  themode = 0;  /* 0 = Leave unchanged              */
  25.                /* 1 = Hi-scan (non-interlaced)     */
  26.                /* 2 = Video scan rate (interlaced) */
  27.  
  28.  
  29. /* 
  30.  * Always include this block of code which loads the libraries:
  31.  */
  32. if ~show('L',"rexxsupport.library") then do
  33.   if addlib('rexxsupport.library',0,-30,0) then do
  34.       /* everything's ok */
  35.     end;
  36.   else do
  37.     say 'We Have A Library Problem, Unable To Load "rexxsupport.library"';
  38.     say 'Cannot operate this module without the library - sorry!';
  39.     exit 10;
  40.     end;
  41.   end;
  42.  
  43. /*
  44.  * Always include this block of code which automatically assigns the ARexx
  45.  * port to the image processor that is running (there are several choices!)
  46.  */
  47. prtnme = 'IP_Port'; /* assume Image Professional */
  48. if show('P','IP_Port') = 0 then do
  49.   if show('P','IM_Port') = 0 then do
  50.     say "Can't find image processor's ARexx port!!!"; /* not running? */
  51.     say "This script requires IP, IM or IM F/c to run!";
  52.     exit(20);
  53.     end;
  54.   else do
  55.     prtnme = 'IM_Port'; /* Imagemaster or Imagemaster F/c */
  56.     end;
  57.   end;
  58.  
  59.   /*
  60.    * This code attempts to read a file called "picmdpath" from REXX:
  61.    * If it can't find it, the script will assume that the commands
  62.    * associated with this PI Module are in "c:". If the file exists,
  63.    * the script will look in the path that is specified in the file.
  64.    * If you create this file, you MUST put a complete, correct path
  65.    * in it; if the commands are in a sub-directory, you have to put
  66.    * the trailing slash on the path (like, device:dir/).
  67.    * 
  68.    */
  69.   cmdpath = 'c:';
  70.   if open(fhandle,'rexx:picmdpath','read') then  /* open the file */
  71.     do
  72.       cmdpath = readln(fhandle);
  73.       call close(fhandle);  /* close the file    */
  74.     end
  75.  
  76. /*
  77.  * The function-specific portion of the script begins here:
  78.  * --------------------------------------------------------
  79.  */
  80.  
  81. address(prtnme);      /* communicate with image processor we found           */
  82.  
  83. options results;
  84. 'pal';
  85. pal = result;
  86. options;
  87.  
  88. if pal > 0 then
  89.   do
  90.     h1 = 256;
  91.     h2 = 280;
  92.     h3 = 512;
  93.     h4 = 566;
  94.   end
  95. else
  96.   do
  97.     h1 = 200;
  98.     h2 = 240;
  99.     h3 = 400;
  100.     h4 = 482;
  101.   end
  102.  
  103. options results;
  104. 'gadgets "Lo-Res","320 to 384","Hi-Res","640 to 768"';
  105. theres = result;
  106. options;
  107. if theres = 0 then do
  108.   address;
  109.   exit 0;
  110.   end
  111. theres = theres - 1;
  112.  
  113. options results;
  114. if theres = 0 then do
  115.   'gadgets "Show non- Lace","320 x' h1 '","Show in Lace","320 x' h3 '"';
  116.   end
  117. else do
  118.   'gadgets "Show non- Lace","640 x' h1 '","Show in Lace","640 x' h3 '"';
  119.   end
  120. thelace = result;
  121. options;
  122. if thelace = 0 then do
  123.   address;
  124.   exit 0;
  125.   end
  126. thelace = thelace - 1;
  127.  
  128. options results;
  129. if theres = 0 & thelace = 0 then do
  130.   'gadgets "Show non- Overscan","320 x' h1 '","Show in Overscan","384 x' h2 '"';
  131.   end
  132. if theres = 0 & thelace = 1 then do
  133.   'gadgets "Show non- Overscan","320 x' h3 '","Show in Overscan","384 x' h4 '"';
  134.   end
  135. if theres = 1 & thelace = 0 then do
  136.   'gadgets "Show non- Overscan","640 x' h1 '","Show in Overscan","768 x' h2 '"';
  137.   end
  138. if theres = 1 & thelace = 1 then do
  139.   'gadgets "Show non- Overscan","640 x' h3 '","Show in Overscan","768 x' h4 '"';
  140.   end
  141. thescan = result;
  142. options;
  143.  
  144. if thescan = 0 then do
  145.   address;
  146.   exit 0;
  147.   end
  148. thescan = thescan - 1;
  149.  
  150. options results;
  151. 'current';
  152. parse var result bname ',' bnum ',' brest
  153. 'jackin';             /* attach to image processor's internal data structure */
  154. jackptr = result;     /* fetch the return value from the std ARexx return    */
  155. options;              /* disallow return values from further commands        */
  156. 'lockimage '||bnum;
  157. address command run cmdpath||'imiv24 '||jackptr||' '||theres||' '||thelace||' '||thescan||' '||themode||' '||pal;
  158. 'unlockimage '||bnum;
  159. exit 0;               /* Done. That's all there is to most PI Modules!       */
  160.